<%@ page import="java.util.Arrays" %>
<%@ page import="java.util.Map" %><%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2023/4/1
  Time: 15:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <head>
        <title>Request对象</title>
    </head>
<body>
<h2>Request对象的第二组方法</h2>
<h3>重点方法</h3>
<%
    // 处理乱码 只针对于post
    request.setCharacterEncoding("utf-8");
    // 获取浏览器发送过来的数据
    // 获取的都是单个数据
    String name = request.getParameter("name");
    String pass = request.getParameter("pass");
    String age = request.getParameter("age");
    // 获取到多选数据
    String[] love = request.getParameterValues("love");
    out.print("姓名：" + name + "<br/>");
    out.print("密码：" + pass + "<br/>");
    out.print("年龄：" + age + "<br/>");
    out.print("爱好：" + Arrays.toString(love) + "<br/>");
    // 获取所有数据 map形式的
    Map<String,String[]> maps = request.getParameterMap();
    out.print(maps);
%>
</body>
</html>
